<div id="must-read">
	<h2>Torneos</h2>

	<div id="tabs">
		<ul>

			<?php

			$this -> load -> model('Torneo_Model');

			$count_tab = 1;
			foreach($tournaments as $row) {
				echo "<li>";
				echo '<a href="#tabs-' . $count_tab . '">';
				echo $row -> tournament_name;
				echo "</a>";
				echo "</li>";
				$count_tab++;
			}
			?><!--
			<li>
			<a href="#tabs-1">Nunc tinci</a>
			</li>
			<li>
			<a href="#tabs-2">Proin dolor</a>
			</li>
			<li>
			<a href="#tabs-3">Aenean laci</a>
			</li>
			<li>
			<a href="#tabs-4">Aenean laci</a>
			</li> -->
		</ul>
		<?php

$count_tab = 1;
foreach($tournaments as $row) {
echo '<div id="tabs-'.$count_tab.'">';
		?>
		<ul>
			<?php

//echo "tournament tab =" . $row->tournament_id ;

$matches = $this -> Torneo_Model -> get_matches_by_tournament_id_limit($row->tournament_id);

If (sizeof($matches) == 0 ){

			?>

			<li>
				Aun no se disputan los Juegos para este torneo.
			</li>

			<?php

			} else {

			foreach($matches as $match) {
			?>

			<li>
				<table style="width: 100%;">
					<tr>
						<th>Equipos</th>
						<th>Anotaciones</th>
						<th></th>
					</tr>
					<tr>
						<td colspan="2" align="right">
						<a href="/index.php/main/match/<?php echo $match -> match_id;?>">Ficha del Partido</a>
						</td>
					</tr>
					<tr>
						<td>
						<a href="#">
						<?php echo $match -> team_home_name;?>
						</a>
						</td>
						<td>
						<?php
						if(empty($match -> home_score)) { echo 0;
						} else { echo $match -> home_score;
						}
						?>
						</td>
						<td></td>
					</tr>
					<tr>
						<td>
						<a href="#">
						<?php echo $match -> team_visit_name;?>
						</a>
						</td>
						<td>
						<?php
						if(empty($match -> visit_score)) { echo 0;
						} else { echo $match -> visit_score;
						}
						?>
						</td>
					</tr>
				</table>
			</li>
			<?php
			}
			}
			?>
		</ul>
	</div>
	<?php
	$count_tab++;
	}
	?>
</div>

<br>

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
	new TWTR.Widget({
		version: 2,
		type: 'profile',
		rpp: 4,
		interval: 6000,
		width: 340,
		height: 300,
		theme: {
			shell: {
				background: '#333333',
				color: '#ffffff'
			},
			tweets: {
				background: '#000000',
				color: '#ffffff',
				links: '#4aed05'
			}
		},
		features: {
			scrollbar: false,
			loop: false,
			live: false,
			hashtags: true,
			timestamp: true,
			avatars: false,
			behavior: 'all'
		}
	}).render().setUser('MontBlancF7').start();
</script>

<ul class="list-3">
	<!--
	<li>
	<b>
	<img src="/images/1page-img3.jpg" alt="">
	<strong>Lorem ipsum dolor sit amet</strong> Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonummy nibh.
	<a href="#">more</a>
	</b>
	</li>
	<li class="extra">
	<b>
	<img src="/images/1page-img4.jpg" alt="">
	<strong>ipsum dolor sit amet</strong> Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonummy nibh.
	<a href="#">more</a>
	</b>
	</li>
	<li>
	<b>
	<img src="/images/1page-img5.jpg" alt="">
	<strong>dolor sit amet</strong> Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonummy nibh.
	<a href="#">more</a>
	</b>
	</li>
	<li class="extra">
	<b>
	<img src="/images/1page-img6.jpg" alt="">
	<strong>Set ipsum dolor sit amet</strong> Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonummy nibh.
	<a href="#">more</a>
	</b>
	</li>
	<li>
	<b>
	<img src="/images/1page-img7.jpg" alt="">
	<strong>Lorem ipsum dolor sit amet</strong> Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonummy nibh.
	<a href="#">more</a>
	</b>
	</li>
	<li class="extra">
	<b>
	<img src="/images/1page-img8.jpg" alt="">
	<strong>ipsum dolor sit amet</strong> Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonummy nibh.
	<a href="#">more</a>
	</b>
	</li> -->
</ul>
<!--
<a href="#" class="link-1">See all</a> -->
<div class="clear">
</div>
</div>